home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / demos / howtoskinacat / titlepic / endpicture.s < prev    next >
Text File  |  1980-01-03  |  9KB  |  507 lines

  1. ùúùúÿËGgÿËGgÿËGgÿËGgÿËGgÿËGgÿËGgÿËGgÿËGgRaster=0
  2.  
  3. Track=1        ;0=ASM-One version
  4.         ;1=Track version
  5.  
  6. MyDmacon=%01111101111
  7. ;      abcdefghhhh
  8. ; a = Blitter nasty
  9. ; b = Enable DMA activity (always set this!)
  10. ; c = Bitplane enable
  11. ; d = Copper enable
  12. ; e = Blitter enable
  13. ; f = Sprite enable
  14. ; g = Disk enable
  15. ; h = Audio channels enable
  16.  
  17. MyIntena=%100000000100000
  18. ;      abcdeeeefghijkl
  19. ; a = Enable interrupts
  20. ; b = Lev. 6 External interrupt
  21. ; c = Lev. 5 Disk sync found
  22. ; d = Lev. 5 Serial port receive buffer full
  23. ; e = Lev. 4 Audio ch. 3-0 block finished
  24. ; f = Lev. 3 Blitter finished
  25. ; g = Lev. 3 Vertical blank
  26. ; h = Lev. 3 Copper
  27. ; i = Lev. 2 I/O Ports and timers
  28. ; j = Lev. 1 Software
  29. ; k = Lev. 1 Disk block finished
  30. ; l = Lev. 1 Serial port transmit buffer empty
  31.  
  32.         SECTION    Kode,code_c
  33.  
  34.  
  35.         JumpPtr    Begin
  36.  
  37. *******************************************************************************
  38. **Macros
  39. *******************************************************************************
  40. WaitBlt:    macro
  41. .vent\@:    btst    #14,$dff002
  42.         bne    .vent\@
  43.         endm
  44.  
  45. *******************************************************************************
  46. **Initialisering
  47. *******************************************************************************
  48. Begin:
  49.         IF    Track=0
  50.         move.w    Intenar+Base,OldIntena
  51.         move.w    Dmacon+Base,OldDmacon
  52.         move.w    #$7fff,Intena+Base
  53.         move.w    #$7fff,Dmacon+Base
  54.         move.w    #$7fff,Intreq+Base
  55.  
  56.         move.l    (Lev3Base).w,OldIrq3
  57.         ELSE
  58.         move.l    #Lev3Irq,(Lev1Base).w
  59.         rts
  60.         ENDC
  61.  
  62.  
  63.         lea    Planer+2,a0
  64.         move.l    #(Pic+64+0*40),d0
  65.         moveq    #6-1,d1
  66. .loop        move.w    d0,4(a0)
  67.         swap    d0
  68.         move.w    d0,(a0)
  69.         swap    d0
  70.         add.l    #40,d0
  71.         addq.w    #8,a0
  72.         dbra    d1,.loop
  73.  
  74.  
  75.         IF    Track=0
  76.         move.l    #Lev3Irq,(Lev3Base).w
  77.         waitblt
  78.  
  79.         move.w    #MyDmacon+$8000,Dmacon+Base
  80.         move.w    #MyIntena+$8000,Intena+Base
  81.  
  82. Wait:
  83.         move.w    IWantOut(pc),d0
  84.         beq.b    wait
  85.  
  86. *******************************************************************************
  87. **Exit to AmigaDOS
  88. *******************************************************************************
  89. ExitToDos:
  90.         move.w    #$7fff,Intena+Base
  91.         move.w    #$7fff,Dmacon+Base
  92.         ENDC
  93.         rts
  94.  
  95. VBlank:        dc.w    0
  96.         IF    Track=0
  97. OldIntena:    dc.w    0
  98. OldDmacon:    dc.w    0
  99. OldIrq3:    dc.l    0
  100. IWantOut:    dc.w    0
  101.         ELSE
  102. IWantOut:    EQU    $80
  103.         ENDC
  104. MegaPause:    dc.w    500
  105.  
  106. *******************************************************************************
  107. **Level 3 interrupt
  108. *******************************************************************************
  109. Lev3Irq:
  110.         movem.l    d0-a6,-(sp)
  111.         move.l    #Copper,Cop2lch+Base
  112.         move.w    d0,Copjmp2+Base
  113.         move.w    #1,VBlank
  114. *******************************************************************************
  115.         bsr    Faders
  116.         cmp.w    #3,Story
  117.         bne.b    .NoLeft
  118. *******************************************************************************
  119.         move.w    #-1,IWantOut
  120. .NoLeft:    if    Raster=1
  121.         move.w    #$f00,Color00+Base
  122.         endif
  123.         waitblt
  124.         if    Raster=1
  125.         move.w    #$00f,Color00+Base
  126.         endif
  127.         movem.l    (sp)+,d0-a6
  128.         IFEQ    Track-0
  129.         move.w    #$0020,Intreq+Base
  130.         ELSE
  131.         move.w    #$0004,Intreq+Base
  132.         ENDC
  133.         rte
  134.  
  135.  
  136. Faders:        move.w    Story(pc),d0
  137.         beq    FadeUp
  138.         subq.w    #1,d0
  139.         beq    CountDown
  140.         subq.w    #1,d0
  141.         beq    FadeDn
  142.         rts
  143.  
  144. CountDown:    subq.w    #1,MegaPause
  145.         bne.b    .ud
  146.         addq.w    #1,Story
  147. .ud:        rts
  148.  
  149. *******************************************************************************
  150. **FadeUpDn
  151. *******************************************************************************
  152. Story:        dc.w    0
  153. FadeUp:
  154.         lea    Colors+2,a0
  155.         lea    Pic,a1
  156.         moveq    #32-1,d7
  157.         moveq    #0,d6
  158. .loop:        move.w    (a0),d0
  159.         move.w    (a1)+,d1
  160.         bsr    fader
  161.         move.w    d0,(a0)
  162.         cmp.w    d0,d1
  163.         bne    .notens
  164.         addq.w    #1,d6
  165. .notens:    addq.w    #4,a0
  166.         dbra    d7,.loop
  167.         cmp.w    #32,d6
  168.         bne    .ud
  169.         addq.w    #1,Story
  170. .ud:        rts
  171.  
  172. FadeDn:
  173.         lea    Colors+2,a0
  174.         moveq    #32-1,d7
  175.         moveq    #0,d6
  176. .loop:        move.w    (a0),d0
  177.         moveq    #0,d1
  178.         bsr    fader
  179.         move.w    d0,(a0)
  180.         cmp.w    d0,d1
  181.         bne    .notens
  182.         addq.w    #1,d6
  183. .notens:    addq.w    #4,a0
  184.         dbra    d7,.loop
  185.         cmp.w    #32,d6
  186.         bne    .ud
  187.         addq.w    #1,Story
  188. .ud:        rts
  189.  
  190. **d0=fade from
  191. **d1=fade to
  192. **out: d0=newcol
  193. fader:        move.w    d0,d2
  194.         move.w    d1,d3
  195.         lsr.w    #8,d2
  196.         lsr.w    #8,d3
  197.         cmp.w    d2,d3
  198.         beq    .nored
  199.         blt    .redsub
  200.         add.w    #$100,d0
  201.         bra    .nored
  202. .redsub:    sub.w    #$100,d0
  203. .nored:        move.w    d0,d2
  204.         move.w    d1,d3
  205.         lsr.w    #4,d2
  206.         lsr.w    #4,d3
  207.         and.w    #$f,d2
  208.         and.w    #$f,d3
  209.         cmp.w    d2,d3
  210.         beq    .nogreen
  211.         blt    .greensub
  212.         add.w    #$10,d0
  213.         bra    .nogreen
  214. .greensub:    sub.w    #$10,d0
  215. .nogreen:    move.w    d0,d2
  216.         move.w    d1,d3
  217.         and.w    #$f,d2
  218.         and.w    #$f,d3
  219.         cmp.w    d2,d3
  220.         beq    .noblue
  221.         blt    .bluesub
  222.         addq.w    #$1,d0
  223.         bra    .noblue
  224. .bluesub:    subq.w    #$1,d0
  225. .noblue:    rts
  226.  
  227. *******************************************************************************
  228. **Copperlist
  229. *******************************************************************************
  230. Copper:
  231.         dc.w    Spr0pth,$0000
  232.         dc.w    Spr0ptl,$0000
  233.         dc.w    Spr1pth,$0000
  234.         dc.w    Spr1ptl,$0000
  235.         dc.w    Spr2pth,$0000
  236.         dc.w    Spr2ptl,$0000
  237.         dc.w    Spr3pth,$0000
  238.         dc.w    Spr3ptl,$0000
  239.         dc.w    Spr4pth,$0000
  240.         dc.w    Spr4ptl,$0000
  241.         dc.w    Spr5pth,$0000
  242.         dc.w    Spr5ptl,$0000
  243.         dc.w    Spr6pth,$0000
  244.         dc.w    Spr6ptl,$0000
  245.         dc.w    Spr7pth,$0000
  246.         dc.w    Spr7ptl,$0000
  247.  
  248.         dc.w    Diwstrt,$4081
  249.         dc.w    Diwstop,$08c1
  250.         dc.w    Ddfstrt,$0038
  251.         dc.w    Ddfstop,$00d0
  252.  
  253.         dc.w    $106,$0c40
  254.  
  255. Colors:    dc.w    $0180,$000,$0182,$000,$0184,$000,$0186,$000
  256.     dc.w    $0188,$000,$018a,$000,$018c,$000,$018e,$000
  257.     dc.w    $0190,$000,$0192,$000,$0194,$000,$0196,$000
  258.     dc.w    $0198,$000,$019a,$000,$019c,$000,$019e,$000
  259.     dc.w    $01a0,$000,$01a2,$000,$01a4,$000,$01a6,$000
  260.     dc.w    $01a8,$000,$01aa,$000,$01ac,$000,$01ae,$000
  261.     dc.w    $01b0,$000,$01b2,$000,$01b4,$000,$01b6,$000
  262.     dc.w    $01b8,$000,$01ba,$000,$01bc,$000,$01be,$000
  263.  
  264.         dc.w    $1001,$fffe
  265. Planer:        dc.w    Bpl1pth,0    ;(Pic+32+0*40)>>16
  266.         dc.w    Bpl1ptl,0    ;(Pic+32+0*40)&$ffff
  267.         dc.w    Bpl2pth,0    ;(Pic+32+1*40)>>16
  268.         dc.w    Bpl2ptl,0    ;(Pic+32+1*40)&$ffff
  269.         dc.w    Bpl3pth,0    ;(Pic+32+2*40)>>16
  270.         dc.w    Bpl3ptl,0    ;(Pic+32+2*40)&$ffff
  271.         dc.w    Bpl4pth,0    ;(Pic+32+3*40)>>16
  272.         dc.w    Bpl4ptl,0    ;(Pic+32+3*40)&$ffff
  273.         dc.w    Bpl5pth,0    ;(Pic+32+3*40)>>16
  274.         dc.w    Bpl5ptl,0    ;(Pic+32+3*40)&$ffff
  275.         dc.w    Bpl6pth,0    ;(Pic+32+3*40)>>16
  276.         dc.w    Bpl6ptl,0    ;(Pic+32+3*40)&$ffff
  277.  
  278.         dc.w    Bpl1mod,5*40
  279.         dc.w    Bpl2mod,5*40
  280.  
  281.         dc.w    Bplcon0,$6200
  282.         dc.w    Bplcon1,$0000
  283.         dc.w    Bplcon2,$0024
  284.  
  285.         dc.w    $ffff,$fffe
  286.  
  287. *******************************************************************************
  288. **Screens+Gfx
  289. *******************************************************************************
  290.         INCDIR    "Work:Code/Sources/HTSAC/TitlePic/"
  291. Pic:        INCBIN    "IHATECAT.raw320*200*6+cmap"
  292.  
  293. TheEnd:
  294.  
  295. *******************************************************************************
  296. **Hardware registers
  297. *******************************************************************************
  298. Bltddat=$000
  299. Dmaconr=$002
  300. Vposr=$004
  301. Vhposr=$006
  302. Dskdatr=$008
  303. Joy0dat=$00a
  304. Joy1dat=$00c
  305. Clxdat=$00e
  306. Adkconr=$010
  307. Pot0dat=$012
  308. Pot1dat=$014
  309. Potgor=$016
  310. Serdatr=$018
  311. Dskbytr=$01a
  312. Intenar=$01c
  313. Intreqr=$01e
  314. Dskpth=$020
  315. Dskptl=$022
  316. Dsklen=$024
  317. Dskdat=$026
  318. Refptr=$028
  319. Vposw=$02a
  320. Vhposw=$02c
  321. Copcon=$02e
  322. Serdat=$030
  323. Serper=$032
  324. Potgo=$034
  325. Joytest=$036
  326. Strequ=$038
  327. Strvbl=$03a
  328. Strhor=$03c
  329. Strlong=$03e
  330. Bltcon0=$040
  331. Bltcon1=$042
  332. Bltafwm=$044
  333. Bltalwm=$046
  334. Bltcpth=$048
  335. Bltcptl=$04a
  336. Bltbpth=$04c
  337. Bltbptl=$04e
  338. Bltapth=$050
  339. Bltaptl=$052
  340. Bltdpth=$054
  341. Bltdptl=$056
  342. Bltsize=$058
  343. Bltcmod=$060
  344. Bltbmod=$062
  345. Bltamod=$064
  346. Bltdmod=$066
  347. Bltcdat=$070
  348. Bltbdat=$072
  349. Bltadat=$074
  350. Dsksync=$07e
  351. Cop1lch=$080
  352. Cop1lcl=$082
  353. Cop2lch=$084
  354. Cop2lcl=$086
  355. Copjmp1=$088
  356. Copjmp2=$08a
  357. Copins=$08c
  358. Diwstrt=$08e
  359. Diwstop=$090
  360. Ddfstrt=$092
  361. Ddfstop=$094
  362. Dmacon=$096
  363. Clxcon=$98
  364. Intena=$09a
  365. Intreq=$09c
  366. Adkcon=$09e
  367. Aud0dat=$0aa
  368. Aud1dat=$0ba
  369. Aud2dat=$0ca
  370. Aud3dat=$0da
  371. Aud0lch=$0a0
  372. Aud1lch=$0b0
  373. Aud2lch=$0c0
  374. Aud3lch=$0d0
  375. Aud0len=$0a4
  376. Aud1len=$0b4
  377. Aud2len=$0c4
  378. Aud3len=$0d4
  379. Aud0per=$0a6
  380. Aud1per=$0b6
  381. Aud2per=$0c6
  382. Aud3per=$0d6
  383. Aud0vol=$0a8
  384. Aud1vol=$0b8
  385. Aud2vol=$0c8
  386. Aud3vol=$0d8
  387. Aud0lcl=$0a2
  388. Aud1lcl=$0b2
  389. Aud2lcl=$0c2
  390. Aud3lcl=$0d2
  391. Bpl1pth=$0e0
  392. Bpl1ptl=$0e2
  393. Bpl2pth=$0e4
  394. Bpl2ptl=$0e6
  395. Bpl3pth=$0e8
  396. Bpl3ptl=$0ea
  397. Bpl4pth=$0ec
  398. Bpl4ptl=$0ee
  399. Bpl5pth=$0f0
  400. Bpl5ptl=$0f2
  401. Bpl6pth=$0f4
  402. Bpl6ptl=$0f6
  403. Bplcon0=$100
  404. Bplcon1=$102
  405. Bplcon2=$104
  406. Bpl1mod=$108
  407. Bpl2mod=$10a
  408. Bpl1dat=$110
  409. Bpl2dat=$112
  410. Bpl3dat=$114
  411. Bpl4dat=$116
  412. Bpl5dat=$118
  413. Bpl6dat=$11a
  414. Spr0pth=$120
  415. Spr0ptl=$122
  416. Spr1pth=$124
  417. Spr1ptl=$126
  418. Spr2pth=$128
  419. Spr2ptl=$12a
  420. Spr3pth=$12c
  421. Spr3ptl=$12e
  422. Spr4pth=$130
  423. Spr4ptl=$132
  424. Spr5pth=$134
  425. Spr5ptl=$136
  426. Spr6pth=$138
  427. Spr6ptl=$13a
  428. Spr7pth=$13c
  429. Spr7ptl=$13e
  430. Spr0pos=$140
  431. Spr0ctl=$142
  432. Spr0data=$144
  433. Spr0datb=$146
  434. Spr1pos=$148
  435. Spr1ctl=$14a
  436. Spr1data=$14c
  437. Spr1datb=$14e
  438. Spr2pos=$150
  439. Spr2ctl=$152
  440. Spr2data=$154
  441. Spr2datb=$156
  442. Spr3pos=$158
  443. Spr3ctl=$15a
  444. Spr3data=$15c
  445. Spr3datb=$15e
  446. Spr4pos=$160
  447. Spr4ctl=$162
  448. Spr4data=$164
  449. Spr4datb=$166
  450. Spr5pos=$168
  451. Spr5ctl=$16a
  452. Spr5data=$16c
  453. Spr5datb=$16e
  454. Spr6pos=$170
  455. Spr6ctl=$172
  456. Spr6data=$174
  457. Spr6datb=$176
  458. Spr7pos=$178
  459. Spr7ctl=$17a
  460. Spr7data=$17c
  461. Spr7datb=$17e
  462. Color00=$180
  463. Color01=$182
  464. Color02=$184
  465. Color03=$186
  466. Color04=$188
  467. Color05=$18a
  468. Color06=$18c
  469. Color07=$18e
  470. Color08=$190
  471. Color09=$192
  472. Color10=$194
  473. Color11=$196
  474. Color12=$198
  475. Color13=$19a
  476. Color14=$19c
  477. Color15=$19e
  478. Color16=$1a0
  479. Color17=$1a2
  480. Color18=$1a4
  481. Color19=$1a6
  482. Color20=$1a8
  483. Color21=$1aa
  484. Color22=$1ac
  485. Color23=$1ae
  486. Color24=$1b0
  487. Color25=$1b2
  488. Color26=$1b4
  489. Color27=$1b6
  490. Color28=$1b8
  491. Color29=$1ba
  492. Color30=$1bc
  493. Color31=$1be
  494. Base=$dff000
  495.  
  496. *******************************************************************************
  497. **Interrupt addresses
  498. *******************************************************************************
  499. Lev1Base=$64
  500. Lev2Base=$68
  501. Lev3Base=$6c
  502. Lev4Base=$70
  503. Lev5Base=$74
  504. Lev6Base=$78
  505. Lev7Base=$7c
  506.  
  507.